<script type="text/javascript" charset="utf-8" src="<?php echo Yii::app()->baseUrl; ?>/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="<?php echo Yii::app()->baseUrl; ?>/js/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="<?php echo Yii::app()->baseUrl; ?>/js/ueditor/lang/zh-cn/zh-cn.js"></script>

<script type="text/javascript">
    UE.getEditor('myEditor1' );
    UE.getEditor('myEditor2' );
</script>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <div class="header clearfix">
        <nav>
            <ul class="nav nav-pills pull-right">
                <li role="presentation" ><a href="<?php echo Yii::app()->baseUrl; ?>/admin/newsType">列表</a></li>
                <li role="presentation" <?php if($data['id']==0){ ?>class="active" <?php } ?>><a href="<?php echo Yii::app()->baseUrl; ?>/admin/newsTypeChange">新增</a></li>
            </ul>
        </nav>
        <h3 class="text-muted"><?php echo $data['id']>0?'修改':'新增';?></h3>
    </div>

    <div class="row placeholders">
        <form class="form-horizontal" method="post" action="<?php echo Yii::app()->baseUrl; ?>/admin/newsChange"  enctype="multipart/form-data">
            <input type="hidden" name="id" value="<?php echo $data['id'] ?>">
            <div class="form-group">
                <label for="inputPassword3" class="col-sm-2 control-label">类型</label>
                <div class="col-sm-10">
                    <select class="form-control" name="_form[type_id]">

                        <?php if(is_array($type)){
                            foreach($type as $k=>$v){
                                ?>
                                <option <?php if($data['type_id']==$v['id']){ ?> selected="selected" <?php } ?> value="<?php echo $v['id'] ?>"><?php echo $v['cn_name'] ?>-<?php echo $v['en_name'] ?></option>
                            <?php }
                        }?>

                    </select>
                </div>
            </div>


            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">列表图(200*100px)</label>
                <div class="col-sm-10">
                    <input type="file" class="form-control" style="margin-bottom: 15px;" name="imgFile">
                </div>
            </div>
            <?php if(!empty($data['img_url'])){?>
                <img src="<?php echo Yii::app()->baseUrl; ?>/<?php echo $data['img_url']; ?>">
            <?php } ?>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">标题(中)</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputEmail3" placeholder="标题名称" name="_form[cn_title]" value="<?php echo $data['cn_title'] ?>">
                </div>
            </div>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">标题(英)</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputEmail3" placeholder="标题名称" name="_form[en_title]" value="<?php echo $data['en_title'] ?>">
                </div>
            </div>

            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">内容(中)</label>
                <div class="col-sm-10">
<!--                    <input type="text" class="form-control" id="inputEmail3" placeholder="类型名称" name="_form[name]" value="--><!--">-->
                    <textarea  id="myEditor1" style="height: 300px"  name="_form[cn_body]" ><?php echo $data['cn_body'] ?></textarea>
                </div>
            </div>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">内容(英)</label>
                <div class="col-sm-10">
                    <!--                    <input type="text" class="form-control" id="inputEmail3" placeholder="类型名称" name="_form[name]" value="--><!--">-->
                    <textarea  id="myEditor2" style="height: 300px"  name="_form[en_body]" ><?php echo $data['en_body'] ?></textarea>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-default">提交</button>
                </div>
            </div>
        </form>
    </div>

</div>